/**
 * API配置文件
 * 统一管理API路径前缀
 */

// 订单相关接口
export const API_ORDER = {
    BASE: `/api/orders`,
    PAGE: `/api/orders/page`,
    DETAIL: (id: string) => `/api/orders/${id}`,
    CREATE: `/api/orders`,
    UPDATE: (id: string) => `/api/orders/${id}`,
    DELETE: (id: string) => `/api/orders/${id}`,
    BATCH_DELETE: `/api/orders/batch`,
    STATISTICS: `/api/orders/statistics/status`,
    EXPORT: `/api/orders/export`
};

// 收货单相关接口
export const API_RECEIPT = {
    BASE: `/api/receipts`,
    PAGE: `/api/receipts/page`,
    DETAIL: (id: string) => `/api/receipts/${id}`,
    CREATE: `/api/receipts`,
    UPDATE: (id: string) => `/api/receipts/${id}`,
    DELETE: (id: string) => `/api/receipts/${id}`,
    BATCH_DELETE: `/api/receipts/batch`,
    STATISTICS: `/api/receipts/statistics`,
    BY_ORDER: (orderId: string) => `/api/receipts/order/${orderId}`,
    EXPORT: `/api/receipts/export`
};

// 发票相关接口
export const API_INVOICE = {
    BASE: `/api/invoices`,
    PAGE: `/api/invoices/page`,
    DETAIL: (id: string) => `/api/invoices/${id}`,
    CREATE: `/api/invoices`,
    UPDATE: (id: string) => `/api/invoices/${id}`,
    DELETE: (id: string) => `/api/invoices/${id}`,
    BATCH_DELETE: `/api/invoices/batch`,
    STATISTICS: `/api/invoices/statistics`,
    VERIFY: (id: string) => `/api/invoices/${id}/verify`,
    EXPORT: `/api/invoices/export`
};

// 匹配相关接口
export const API_MATCH = {
    BASE: `/api/match`,
    PAGE: `/api/match/page`,
    LIST: `/api/match/page`,
    DETAIL: (id: string) => `/api/match/${id}`,
    CREATE: `/api/match`,
    UPDATE: (id: string) => `/api/match/${id}`,
    DELETE: (id: string) => `/api/match/${id}`,
    BATCH_DELETE: `/api/match/batch`,
    STATISTICS: `/api/match/statistics`,
    AUTO: `/api/match/auto`,
    AVAILABLE_ORDERS: `/api/match/available-orders`,
    MATCHED_ORDERS: `/api/match/matched-orders`,
    MATCH_CANDIDATES: (orderId: string) => `/api/match/match-candidates/${orderId}`,
    GLOBAL_MATCH: `/api/match/global-match`,
    AUTO_MATCH: `/api/match/auto-match`,
    EXPORT: `/api/match/export`
};

// 文件上传相关接口
export const API_FILE = {
    UPLOAD: `/api/file/upload`,
    DELETE: `/api/file/delete`,
    UPLOAD_BASE64: `/api/file/upload-base64`
};

// 统一响应结构接口
export interface ApiResponse<T> {
    code: number;
    message: string;
    success: boolean;
    data: T;
} 